echo -e "[$(date +%H:%M:%S)]"&& pacman -S proot talloc --needed --noconfirm
cd ~
mkdir arch
cd arch
command -v axel
if [ $? = 0 ]; then
echo -e "[$(date +%H:%M:%S)]"&& axel http://mirrors.bfsu.edu.cn/archlinuxarm/os/ArchLinuxARM-aarch64-latest.tar.gz
else
echo -e "[$(date +%H:%M:%S)]"&& curl -O  http://mirrors.bfsu.edu.cn/archlinuxarm/os/ArchLinuxARM-aarch64-latest.tar.gz
fi
echo -e "[$(date +%H:%M:%S)]"&& tar -xvpf ArchLinuxARM-aarch64-latest.tar.gz
cd ~
cat >$PREFIX/bin/sa<< 'EOL'
#!/usr/bin/bash
cd ~
unset LD_PRELOAD
command="proot"
command+=" --link2symlink"
command+=" -0"
command+=" -r arch"
command+=" -b /dev"
command+=" -b /proc"
command+=" -b arch/root:/dev/shm"
#此为挂载/data目录的命令，以便读取终端的二进制文件，建议在拥有root权限开启
command+=" -b /data"
command+=" -b /sdcard"
command+=" -w /root"
command+=" /usr/bin/env -i"
command+=" HOME=/root"
command+=" PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games"
command+=" TERM=$TERM"
command+=" LANG=zh_CN.UTF-8"
command+=" TZ=UTC+8"
command+=" /bin/bash --login"
exec $command
EOL
chmod 700 $PREFIX/bin/sa
cd ~/arch/bin/
read -p "是否一同安装xfce桌面？[y/n]" desktop
if [ $desktop = y ]; then
echo -e "[$(date +%H:%M:%S)]"&&curl -O https://gitee.com/Galcn/TAI/raw/master/Arch/config
else
echo -e "[$(date +%H:%M:%S)]"&&curl -O https://gitee.com/Galcn/TAI/raw/master/Arch/config-nodesktop -o config
fi
chmod 755 config
cd ~
echo "config">~/arch/root/.bash_profile
sa